package Application

import (
	"fmt"
	"runtime"
	"unsafe"
)

type Poin struct {
	Left, Begin int
}

func RunMoreUnsafe() {
	fmt.Println("(((((((((((((((((((((((")
	var mem runtime.MemStats
	array := [...]int64{0, 1, 2, 3, -2, 4}
	kk := &Poin{1, 2}
	up := unsafe.Pointer(kk)
	fmt.Println(up)
	fmt.Println((*Poin)(up))
	pointer := &array[0]
	fmt.Println(*pointer, " ")
	memoryAddress := uintptr(unsafe.Pointer(pointer)) + unsafe.Sizeof(pointer)
	PrintStats(mem)
	for i := 0; i < len(array)-1; i++ {
		pointer = (*int64)(unsafe.Pointer(memoryAddress))
		fmt.Print(*pointer, " ")
		memoryAddress = uintptr(unsafe.Pointer(pointer)) + unsafe.Sizeof(pointer)
		// PrintStats(mem)
	}
	// PrintStats(mem)
}
